home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / adatutor / lrmrdr / chapab.doc < prev    next >
Text File  |  1996-01-30  |  10KB  |  308 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6. The following document is a draft  of  the  corresponding  chapter  of  the
  7. version  of  the  Ada  Reference  Manual  produced  in response to the Ansi
  8. Canvass.  It is given a limited circulation  to  Ada  implementers  and  to
  9. other groups contributing comments (according to the conventions defined in
  10. RRM.comments).  This draft should not be referred to in any publication.
  11.  
  12.  
  13.  
  14.                        ANSI-RM-B-v23 - Draft Chapter
  15.  
  16.                       B  Predefined Language Pragmas
  17.                                 version 23
  18.  
  19.                                  83-02-11
  20.  
  21.            This revision has addressed all comments up to #5795
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77. >                       B. Predefined Language Pragmas
  78.  
  79.  
  80.  
  81. This annex defines the pragmas LIST, PAGE, and OPTIMIZE, and summarizes the
  82. definitions given elsewhere of the remaining language-defined pragmas.
  83.  
  84. Pragma                                   Meaning
  85.  
  86. CONTROLLED     Takes the simple name  of  an  access  type  as  the  single
  87.                argument.   This  pragma  is only allowed immediately within
  88.                the declarative part or package specification that  contains
  89.                the  declaration  of  the access type;  the declaration must
  90.                occur before the pragma.  This pragma is not allowed  for  a
  91.                derived  type.  This pragma specifies that automatic storage
  92.                reclamation must not be performed for objects designated  by
  93.                values of the access type, except upon leaving the innermost
  94.                block statement, subprogram body, or task body that encloses
  95.                the  access  type  declaration,  or  after  leaving the main
  96.                program (see 4.8).
  97.  
  98. ELABORATE      Takes one or more simple names  denoting  library  units  as
  99.                arguments.   This  pragma  is only allowed immediately after
  100.                the  context  clause  of  a  compilation  unit  (before  the
  101.                subsequent  library  unit or secondary unit).  Each argument
  102.                must be the simple name of a library unit mentioned  by  the
  103.                context    clause.    This   pragma   specifies   that   the
  104.                corresponding library unit body must  be  elaborated  before
  105.                the  given  compilation unit.  If the given compilation unit
  106.                is a subunit, the  library  unit  body  must  be  elaborated
  107.                before  the body of the ancestor library unit of the subunit
  108.                (see 10.5).
  109.  
  110. INLINE         Takes one or more names as arguments;  each name  is  either
  111.                the   name  of  a  subprogram  or  the  name  of  a  generic
  112.                subprogram.  This pragma is only allowed at the place  of  a
  113.                declarative   item   in   a   declarative  part  or  package
  114.                specification, or after a library unit in a compilation, but
  115.                before  any  subsequent  compilation  unit.    This   pragma
  116.                specifies  that  the  subprogram  bodies  should be expanded
  117.                inline at each call  whenever possible;  in the  case  of  a
  118.                generic  subprogram,  the  pragma  applies  to  calls of its
  119.                instantiations (see 6.3.2).
  120.  
  121. INTERFACE      Takes a language name and a subprogram  name  as  arguments.
  122.                This  pragma  is allowed at the place of a declarative item,
  123.                and must apply in this case to a subprogram declared  by  an
  124.                earlier  declarative  item  of  the same declarative part or
  125.                package specification.  This pragma is also  allowed  for  a
  126.                library unit;  in this case the pragma must appear after the
  127.                subprogram    declaration,   and   before   any   subsequent
  128.                compilation unit.  This pragma specifies the other  language
  129.                (and  thereby  the  calling  conventions)  and  informs  the
  130.                compiler that an object module  will  be  supplied  for  the
  131.                corresponding subprogram (see 13.9).
  132.  
  133. LIST           Takes one of  the  identifiers  ON  or  OFF  as  the  single
  134.                argument.   This  pragma  is  allowed  anywhere  a pragma is
  135.                allowed.  It specifies that listing of the compilation is to
  136.                be continued or suspended  until  a  LIST  pragma  with  the
  137.                opposite argument is given within the same compilation.  The
  138.                pragma  itself is always listed if the compiler is producing
  139.                a listing.
  140.  
  141. MEMORY_SIZE    Takes a numeric literal as the single argument.  This pragma
  142.                is only allowed at the start of a  compilation,  before  the
  143.                first  compilation  unit  (if  any) of the compilation.  The
  144.                effect of this pragma is to use the value of  the  specified
  145.                numeric  literal  for  the  definition  of  the named number
  146.                MEMORY_SIZE (see 13.7).
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192. OPTIMIZE       Takes one of the identifiers TIME or  SPACE  as  the  single
  193.                argument.   This pragma is only allowed within a declarative
  194.                part and it applies to  the  block  or  body  enclosing  the
  195.                declarative part.  It specifies whether time or space is the
  196.                primary optimization criterion.
  197.  
  198. PACK           Takes the simple name of a  record  or  array  type  as  the
  199.                single  argument. The allowed positions for this pragma, and
  200.                the restrictions on the named type, are governed by the same
  201.                rules as for a representation clause. The  pragma  specifies
  202.                that  storage minimization should be the main criterion when
  203.                selecting the representation of the given type  (see  13.1).
  204.  
  205. PAGE           This pragma has no  argument,  and  is  allowed  anywhere  a
  206.                pragma is allowed.  It specifies that the program text which
  207.                follows  the  pragma  should  start  on  a  new page (if the
  208.                compiler is currently producing a listing).
  209.  
  210. PRIORITY       Takes a static expression of the predefined integer  subtype
  211.                PRIORITY  as  the  single  argument.   This  pragma  is only
  212.                allowed  within  the  specification  of  a  task   unit   or
  213.                immediately  within the outermost declarative part of a main
  214.                program.  It specifies the priority of the task (or tasks of
  215.                the task type) or the priority  of  the  main  program  (see
  216.                9.8).
  217.  
  218. SHARED         Takes the simple name of a variable as the single  argument.
  219.                This  pragma  is  allowed only for a variable declared by an
  220.                object declaration and whose type  is  a  scalar  or  access
  221.                type;   the  variable  declaration  and the pragma must both
  222.                occur  (in  this  order)   immediately   within   the   same
  223.                declarative  part  or  package  specification.   This pragma
  224.                specifies that every read or update of  the  variable  is  a
  225.                synchronization  point for that variable.  An implementation
  226.                must restrict the objects for which this pragma  is  allowed
  227.                to  objects  for  which  each  of  direct reading and direct
  228.                updating is implemented as  an  indivisible  operation  (see
  229.                9.11).
  230.  
  231. STORAGE_UNIT   Takes a numeric literal as the single argument.  This pragma
  232.                is  only  allowed  at the start of a compilation, before the
  233.                first compilation unit (if any)  of  the  compilation.   The
  234.                effect  of  this pragma is to use the value of the specified
  235.                numeric literal for  the  definition  of  the  named  number
  236.                STORAGE_UNIT (see 13.7).
  237.  
  238. SUPPRESS       Takes as arguments the identifier of a check and  optionally
  239.                also  the  name  of  either  an object, a type or subtype, a
  240.                subprogram, a task unit, or a generic unit.  This pragma  is
  241.                only allowed either immediately within a declarative part or
  242.                immediately  within  a package specification.  In the latter
  243.                case, the only allowed form is with a name that  denotes  an
  244.                entity   (or   several   overloaded   subprograms)  declared
  245.                immediately   within   the   package   specification.    The
  246.                permission to omit the given check extends from the place of
  247.                the  pragma  to the end of the declarative region associated
  248.                with the innermost  enclosing  block  statement  or  program
  249.                unit.   For  a  pragma given in a package specification, the
  250.                permission extends to the end of  the  scope  of  the  named
  251.                entity.
  252.  
  253.                If  the  pragma  includes a name, the permission to omit the
  254.                given check is further restricted:  it  is  given  only  for
  255.                operations on the named object or on all objects of the base
  256.                type  of  a  named  type  or  subtype;  for calls of a named
  257.                subprogram;  for activations of  tasks  of  the  named  task
  258.                type;   or for instantiations of the given generic unit (see
  259.                11.7).
  260.  
  261. SYSTEM_NAME    Takes an enumeration literal as the  single  argument.  This
  262.                pragma is only allowed at the start of a compilation, before
  263.                the first compilation unit (if any) of the compilation.  The
  264.                effect of this pragma is to use the enumeration literal with
  265.                the  specified identifier for the definition of the constant
  266.                SYSTEM_NAME.  This pragma is only allowed if  the  specified
  267.                identifier  corresponds  to  one of the literals of the type
  268.                NAME declared in the package SYSTEM (see 13.7).
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.